using Cavy.UdpClient.Serializable;

namespace Cavy.UdpClient
{
    public struct Message_FindRoomLan : IMessage
    {
        public int MessageType => (int)MessageTypeEnum.FindRoomLan;
        public void Serialize(NetDataWriter writer)
        {
            
        }

        public void Deserialize(NetDataReader reader)
        {
            
        }

        public void AnalysisData(MessageFactory factory, IpEndPoint endPoint)
        {
            var room = factory.As<UdpRoom>();
            if(!string.IsNullOrEmpty(room.RoomName))
                room.Transport.Send(new Message_FindRoomLanResponse(){RoomName = room.RoomName}, endPoint);
        }
    }
}